/* Copyright © 2010 LPRM
Universidade Federal do Espírito Santo - RNP-GT CWTools

This file is part of GW-Android.

GW-Android is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

GW-Android is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with GW-Android. If not, see <http://www.gnu.org/licenses/>. */
package br.ufes.cwtools.gw.android.location_service;

import com.google.android.maps.GeoPoint;

public class GeoObject {
	public static final String TYPE_PHOTO = "photo";
	public static final String TYPE_USER = "user";
	
	private final GeoPoint point;
	private final String label;
	private String reference;
	private String type;
	
	public GeoObject(double latDegrees, double lonDegrees, String label,
			String reference, String type) {
		this.point = new GeoPoint((int) (latDegrees * 1E6), (int) (lonDegrees * 1E6));
		this.label = label != null ? label : "Unnamed";
		this.reference = reference;
		this.type = type;  // TODO Check if type is valid.
	}
	
	public GeoPoint getGeoPoint() {
		return point;
	}

	public String getLabel() {
		return label;
	}

	public String getReference() {
		return reference;
	}

	public String getType() {
		return type;
	}
	
	public int getMarker() {
		if (type.equalsIgnoreCase(TYPE_PHOTO)) {
			return R.drawable.camera_icon;
		} else if (type.equalsIgnoreCase(TYPE_USER)) {
			return R.drawable.androidmarker;
		} else {
			return R.drawable.icon;
		}
	}
}